package cn.java78.springboot.myschool.ctrl;

import cn.java78.springboot.myschool.config.SMSConfig;
import cn.java78.springboot.myschool.printer.Printer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author oldliu
 * @since 1.0
 */
@RestController//Controller +ResponseBody
@RequestMapping("hello")
public class HelloController {

    @Resource
    private SMSConfig config;
    @Resource(name = "p2")
    private Printer printer;
    @RequestMapping("printer")
    public Printer showPrinter(){
        return printer;
    }
    @RequestMapping("config")
    public SMSConfig showConfig(){
        return config;
    }

    @RequestMapping("sayhi")
    public String hello(){
        return "hi,springboot";
    }
}
